home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / subs.m_m < prev    next >
Text File  |  1995-03-23  |  7KB  |  266 lines

  1. Article 1537 of comp.sys.handhelds:
  2. Path: en.ecn.purdue.edu!noose.ecn.purdue.edu!samsung!cs.utexas.edu!sun-barr!olivea!mintaka!bloom-beacon!eru!hagbard!luth!d89-mlt
  3. From: d89-mlt@sm.luth.se (Morgan Lindqvist)
  4. Newsgroups: comp.sys.handhelds
  5. Subject: Subs game to hp48
  6. Keywords: game,hp48
  7. Message-ID: <1147@tau.sm.luth.se>
  8. Date: 28 Sep 90 08:21:02 GMT
  9. Distribution: comp
  10. Organization: University of Lulea, Sweden
  11. Lines: 251
  12.  
  13.  
  14. Here comes a submarine game called U137, from M&M
  15.  
  16. Mattias Dahl                 &            Morgan Lindvqist
  17. d89-mdl@sm.luht.se                        d89-mlt@sm.luth.se
  18.  
  19.                  University of Lulea, SWEDEN
  20.  
  21. -------------------------------------------------------------------------
  22.         _           _           _ _                   _           _
  23.        /   \       /   \      /     \              /   \       /   \ 
  24.       |     |     |     |    |       |             |     |     |     |
  25.       |      \ _ /      |    |       |             |      \ _ /      |
  26.       |       |_|       |     \     /              |       |_|       |
  27.       |                 |       \ /                |                 |
  28.       |                 |       / \                |                 |
  29.       |                 |     /     \              |                 |
  30.       |                 |    |        \   /        |                 |
  31.  /    |                 |    |          X     /    |                 |
  32.  \ _ /                   \_   \ _ _ _ /   \   \ _ /                   \ _
  33.               
  34.  
  35. -------------------------------------------------------------------------
  36.  
  37. Excuse for any grammar mistakes.
  38.  
  39. In this game you are going to sink submarines in the Swedish
  40. archipelago.
  41.  
  42. All the subs exists in a 10x10 square.
  43.  
  44. You move your ship with the arrow keys (Up down left right) and drop bombs
  45. with enter. On the left part of the screen you can watch the distances to
  46. the subs and in the upper right corner your current position.
  47.  
  48.  
  49. The * in the figure below is your ship and the numbers symbolizes 
  50. the distances to the subs. 
  51.  
  52. The numbers aren't there in the game we just plotted them here 
  53. so it shouldn't be so hard to explain.
  54.    __________________________________________
  55.    |    |   |   |   |   |   |   |   |   |   |
  56.    |____|___|___|___|___|___|___|___|___|___|
  57.    |    | 2 | 2 | 2 | 2 | 2 |   |   |   |   |
  58.    |____|___|___|___|___|___|___|___|___|___|
  59.    |    | 2 | 1 | 1 | 1 | 2 |   |   |   |   |
  60.    |____|___|___|___|___|___|___|___|___|___|
  61.    |    | 2 | 1 | * | 1 | 2 |   |   |   |   |
  62.    |____|___|___|___|___|___|___|___|___|___|
  63.    |    | 2 | 1 | 1 | 1 | 2 |   |   |   |   |
  64.    |____|___|___|___|___|___|___|___|___|___|
  65.    |    | 2 | 2 | 2 | 2 | 2 |   |   |   |   |
  66.    |____|___|___|___|___|___|___|___|___|___|
  67.    |    |   |   |   |   |   | 3 |   |   |   |
  68.    |____|___|___|___|___|___|___|___|___|___|
  69.    |    |   |   |   |   |   |   | 4 |   |   |
  70.    |____|___|___|___|___|___|___|___|___|___|
  71.    |    |   |   |   |   |   |   |   | 5 | 6 |
  72.    |____|___|___|___|___|___|___|___|___|___|
  73.    |    |   |   |   |   |   |   |   | 6 | 6 |
  74.    |____|___|___|___|___|___|___|___|___|___|
  75.    
  76.  
  77.  
  78.    To start the game
  79.  
  80.    4:
  81.    3:
  82.    2:
  83.    1: number off subs        2-8
  84.  
  85.    Then press U137
  86.  
  87.    Play the game
  88.  
  89.    4:
  90.    3:
  91.    2:      Moves:10
  92.    1: Submarines: 3
  93.  
  94.  
  95. You have four difficulty levels 
  96.  
  97.   1:   The subs light up after you have dropped a bomb. And they
  98.        are still at that position the next move.
  99.        Flag 59 set 
  100.        Flag 60 Clear 
  101.        (This is a very easy level)
  102.  
  103.   2:   The subs don't light up and they are lying still.
  104.        Flag 59 Clear
  105.        Flag 60 Clear
  106.  
  107.   3:   The subs light up and they are moving around.
  108.        Flag 59 Set
  109.        Flag 60 Set
  110.  
  111.   4:   The subs don't light up and they are moving around.
  112.        Flag 59 Clear
  113.        Flag 60 Set
  114.  
  115. You must set and clear the flags by your self.
  116.  
  117.  
  118.  
  119. Background:
  120.  
  121.   Why did we call the game U137, if you think hard you might remember 
  122.   a Russian submarine named U137 that drove up on SWEDISH land an night in
  123.   the early 80's . The Russians got there sub back and the swedish marine
  124.   got more money, but we still have Unidentified underwater activity in our
  125.   territorial water, as it so nicely is called.
  126.   
  127. ____________________________________________________________________________
  128. %%HP: T(3)A(D)F(.);
  129. DIR 
  130.  U137
  131. \<< 2 - 7 MOD 2 + DUP INIT (5,5) \-> ANT POS AIM
  132.   \<< 0 POS AIM ANT WFACT 'POS' STO DROP
  133.       AIM GMARK
  134.       DO 1 + POS AIM GETK DUP 'AIM' STO ANT WFACT 'POS' STO OBJ\->
  135.       UNTIL 1 SWAP 1 -
  136.       START + 
  137.       NEXT 0 SAME
  138.     END MOVES \->TAG
  139.   \>>
  140. \>>
  141.  
  142.  GETK
  143. \<<
  144.   DO
  145.     DO KEY UNTIL END
  146.   UNTIL
  147.     CASE
  148.      DUP 25 SAME
  149.       THEN 24 - GMOVE 0
  150.       END
  151.      DUP DUP DUP 34 SAME SWAP 35 SAME OR SWAP 36 SAME OR
  152.       THEN 32 - GMOVE 0
  153.       END
  154.      51 SAME
  155.       THEN 1
  156.       END
  157.      0
  158.     END
  159.   END
  160. \>>
  161.  
  162.  GMOVE
  163. \<< \-> P V
  164.   \<< P C\->R
  165.     CASE V 1 SAME
  166.       THEN
  167.         IF DUP 1 SAME NOT
  168.         THEN 1 -
  169.         END
  170.       END V 2 SAME
  171.       THEN SWAP
  172.         IF DUP 1 SAME NOT
  173.         THEN 1 -
  174.         END SWAP
  175.       END V 3 SAME
  176.       THEN
  177.         IF DUP 10 SAME NOT
  178.         THEN 1 +
  179.         END
  180.       END SWAP
  181.       IF DUP 10 SAME NOT
  182.       THEN 1 +
  183.       END SWAP
  184.     END R\->C DUP 'V' STO GMARK P GMARK 
  185.     PICT { # 107d # 0d } V \->STR " " + 1 \->GROB REPL V
  186.   \>>
  187. \>>
  188.  
  189.  GMARK
  190. \<< C\->R
  191.     1 - 6 * 1 + R\->B SWAP
  192.     1 - 6 * 2 + R\->B SWAP
  193.     2 \->LIST PICT SWAP "*" 1 \->GROB GXOR
  194. \>>
  195.  
  196.  INIT
  197. \<< \-> A
  198.   \<<
  199.     PICT { # 0d # 0d } # 131d # 64d
  200.     BLANK REPL { # 0d# 0d } PVIEW
  201.     0 10 FOR X
  202.       # 0d X 6 * R\->B 2 \->LIST DUP 1 # 60d PUT LINE
  203.       6 X * R\->B # 0d 2 \->LIST DUP 2 # 60d PUT LINE
  204.     NEXT
  205.     PICT { # 67d # 0d } "Aiming at (5,5)" 1 \->GROB REPL
  206.     PICT { # 67d # 6d } "MOVES" 1 \->GROB REPL
  207.     1 A FOR X
  208.      PICT # 67d X 1 + 6 * R\->B 2 \->LIST "SUB :" X + 1 \->GROB REPL
  209.      RAND 10 * IP 1 + RAND 10 * IP 1 + R\->C
  210.     NEXT A \->LIST
  211.   \>>
  212. \>>
  213.  
  214.  WFACT
  215. \<< 0 \-> POS AIM ANT DIS
  216.   \<< POS ANT AIM MSUB 'POS' STO 'DIS' STO 
  217.      1 ANT FOR X 
  218.        PICT # 104d X 1 + 6 * R\->B 2 \->LIST 'DIS' X GET
  219.        IF DUP 0 SAME THEN 
  220.          DROP "SUNKEN"
  221.        ELSE 
  222.          \->STR
  223.        END 1 \->GROB REPL
  224.      NEXT PICT {# 104d # 6d } 3 PICK \->STR 1 \->GROB REPL
  225.      DIS POS
  226.   \>>
  227. \>>
  228.  
  229.  MSUB
  230. \<< \-> POS ANT AIM
  231.   \<< 1 ANT
  232.     FOR X 'POS' X GET
  233.       IF DUP 0 SAME NOT
  234.       THEN AIM - C\->R ABS SWAP ABS MAX
  235.         IF DUP 0 SAME
  236.         THEN 'POS' X 0 PUT
  237.         ELSE
  238.           IF 59 FS?
  239.           THEN
  240.             'POS' X GET DUP GMARK GMARK
  241.           END
  242.           IF 60 FS?
  243.           THEN
  244.             'POS' DUP X GET C\->R 1 2
  245.             START 
  246.               RAND 3 * IP 1 - + 
  247.               IF DUP 10 >
  248.               THEN 1 -
  249.               END
  250.               IF DUP 1 <
  251.               THEN 1 +
  252.               END
  253.               SWAP
  254.             NEXT
  255.             R\->C X SWAP PUT
  256.           END
  257.         END
  258.       END
  259.     NEXT ANT \->LIST POS
  260.   \>>
  261. \>>
  262.  
  263. END
  264.  
  265.  
  266.